package cn.iocoder.yudao.module.erp.dal.mysql.business.money.moneyaccount;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.erp.controller.admin.business.money.moneyaccount.vo.MoneyAccountPageReqVO;
import cn.iocoder.yudao.module.erp.dal.dataobject.business.money.moneyaccount.MoneyAccountDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 资金账户 Mapper
 *
 * @author yy
 */
@Mapper
public interface MoneyAccountMapper extends BaseMapperX<MoneyAccountDO> {

    default PageResult<MoneyAccountDO> selectPage(MoneyAccountPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<MoneyAccountDO>()
                .likeIfPresent(MoneyAccountDO::getName, reqVO.getName())
                .betweenIfPresent(MoneyAccountDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(MoneyAccountDO::getId));
    }

}